package com.example.config;

import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: dangwen
 * @createDate: 2020/12/7
 * 采用json格式的序列化器，mq中的消息存放的是json格式的数据，而不是二进制数据
 */
@Configuration
public class MyRabbitMQConfig {

    @Bean
    public MessageConverter getMessageConverter(){
        return new Jackson2JsonMessageConverter();
    }
}
